package com.example.demo.aspect;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
@Slf4j
//@Component
@Aspect
@Order(3)
public class demo1 {



        @Pointcut("execution(* com.example.demo.controller.*.*(..))")
        public void pt(){};

        //前置通知
        @Before("pt()")
        public void doBefore() {
            log.info("执⾏ Before1 ⽅法");
        }
        //后置通知
        @After("pt()")
        public void doAfter() {
            log.info("执⾏ After1 ⽅法");
        }
}
